/*
 * @(#)GDialogPeer.java	1.14 06/10/10
 *
 * Copyright  1990-2008 Sun Microsystems, Inc. All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 only, as published by the Free Software Foundation. 
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License version 2 for more details (a copy is
 * included at /legal/license.txt). 
 * 
 * You should have received a copy of the GNU General Public License
 * version 2 along with this work; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA 
 * 
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
 * Clara, CA 95054 or visit www.sun.com if you need additional
 * information or have any questions. 
 *
 */

package sun.awt.gtk;

import java.awt.*;
import sun.awt.peer.*;
import java.awt.event.*;

/**
 *
 *
 * @author Nicholas Allen
 */

class GDialogPeer extends GWindowPeer implements DialogPeer {
    private static int defaultLeftBorder = 6;
    private static int defaultRightBorder = 6;
    private static int defaultTopBorder = 19;
    private static int defaultBottomBorder = 6;
    /** Creates a new GDialogPeer. */

    GDialogPeer (GToolkit toolkit, Dialog target) {
        super(toolkit, target);
        // first "if" block added for Bug #4700136
        if ((target.getTitle() == "") && (target instanceof FileDialog))
            setTitle(" ");
        else
            setTitle(target.getTitle());
        setResizable(target.isResizable());
        setModal(target.isModal());
    }
	
    /** Sets up border values to some sensible values for this window. */
	
    void initBorders() {
        topBorder = defaultTopBorder;
        leftBorder = defaultLeftBorder;
        bottomBorder = defaultBottomBorder;
        rightBorder = defaultRightBorder;
    }
	
    /** Sets the default border values to be used for future windows. */
	
    void setDefaultBorders(int top, int left, int bottom, int right) {
        defaultTopBorder = top;
        defaultLeftBorder = left;
        defaultBottomBorder = bottom;
        defaultRightBorder = right;
    }
	
    protected native void create();
	
    public void setTitle(String title) {
        if (title != null)
            setTitleNative(stringToNulMultiByte(title));
    }

    protected native void setTitleNative(byte[] title);

    native void setModal(boolean modal);
}
